package com.demotest;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;

@SpringBootApplication
public class GrilsSpringbootApplication extends SpringBootServletInitializer {

	/**
	 * 用于部署在外部tomcat的设置
	 * @param application
	 * @return
	 */
	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
		return application.sources(GrilsSpringbootApplication.class);

	}

	/**
	 * 开发使用内置tomcat启动类
	 * @param args
	 * @throws Exception
	 */
	public static void main(String[] args) throws Exception {
		SpringApplication.run(GrilsSpringbootApplication.class, args);
	}
}
